import requests from "./request";
import mockRequests from './mockAjax'

// export const getCategoryList=()=>{
//     return requests({
//     url:'/product/getBaseCategoryList',
//     method:'get' 
//     })
// } 
//获取三级菜单数据
export const getCategoryList=()=>requests({
    url:'/product/getBaseCategoryList',
    method:'get' 
    });
//获取banner数据（mock）
export const getBannerList=()=>mockRequests({
    url:'/banner',
    method:'get'
});
//获取搜索模块数据(需要接收参数)
export const getSearchInfo=(params)=>requests({
    url:'/list',
    method:'post',
    data:params
});
//获取验证码,接口：/api/user/passport/sendCode/{phone}
export const getCode=(phone)=>requests({
    url:`/api/user/passport/sendCode/${phone}`,
    method:'get'
})
//注册
//url:/api/user/passport/register  method:post    phone code password

export const userRegister = (data)=>requests({url:'/user/passport/register',data,method:'post'});

//登录
//URL:/api/user/passport/login  method:post phone password
export const userLogin = (data)=>requests({url:'/user/passport/login',data,method:'post'});


//获取用户信息【需要带着用户的token向服务器要用户信息】
//URL:/api/user/passport/auth/getUserInfo  method:get 
export const userInfo = ()=>requests({url:'/user/passport/auth/getUserInfo',method:'get'});


//退出登录
//URL:/api/user/passport/logout  get
export const logout = ()=> requests({url:'/user/passport/logout',method:'get'});
